package main

import "github.com/gofiber/fiber/v2"

/**
 * @author  kongling
 * @package fiber
 * @date    2023/12/5 上午11:31
 */
func main() {
	app := fiber.New()

	app.Get("/:name?", func(c *fiber.Ctx) error {
		if c.Params("name") != "" {
			return c.SendString("Hello " + c.Params("name"))
			// => Hello john
		}
		return c.SendString("Where is john?")
	})
	err := app.Listen(":3000")
	if err != nil {
		return
	}
}
